package com.monlyu.action.message;

import com.monlyu.action.BaseAction;
import com.monlyu.annotation.ActionAnno;
import com.monlyu.bo.MessageBo;
import com.monlyu.vo.Message;

/********************************************************************************
 * 
 * <b>功能描述☞</b><br>
 * 
 * <b>开发公司☞</b>重庆唯尼科技有限公司<br>
 * <b>版权☞</b>本文件归重庆唯尼科技有限公司所有<br>
 * <b>项目名☞</b>NewsSys<br>
 * <b>文件路径☞</b>com.monlyu.action.message.EditMessageAction.java<br>
 * <b>开发日期☞</b>2010-2-24 <br>
 * 
 * @author zengjun
 * @since JDK 5
 * @version 1.0.8
 * 
 ********************************************************************************/
public class EditMessageAction extends BaseAction {

	private Message msg;

	private MessageBo messageBo;

	@ActionAnno(readOnly = false)
	public String execute() {
		return ajax(messageBo.insert(msg));
	}

	@ActionAnno(readOnly = false)
	public String delete() {
		messageBo.delete(Message.class, msg.getId());
		return ajax();
	}
	
	@ActionAnno(readOnly = false)
	public String deleteAll() {
		return ajax(messageBo.deleteOldMsgs());
	}

	public Message getMsg() {
		return msg;
	}

	public void setMsg(Message msg) {
		this.msg = msg;
	}

	public void setMessageBo(MessageBo messageBo) {
		this.messageBo = messageBo;
	}
}
